const zhArr = Object.entries(import.meta.glob('./zh/*.ts', { eager: true, import: 'default' }))
const enArr = Object.entries(import.meta.glob('./en/*.ts', { eager: true, import: 'default' }))
const zh = zhArr
  .map((item) => {
    const key = item[0].replace(/^\.\/zh\//, '').replace(/\.ts$/, '')
    return { [key]: item[1] }
  })
  .reduce((a, b) => Object.assign(a, b), {})

const en = enArr
  .map((item) => {
    const key = item[0].replace(/^\.\/en\//, '').replace(/\.ts$/, '')
    return { [key]: item[1] }
  })
  .reduce((a, b) => Object.assign(a, b), {})

export default {
  zh,
  en
}
